/**
*      author: Y_Yao
*      created: 2025-02-01 20:38:01
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 7;
int n,w,q;
struct node
{
    int x,y;
};

bool cmp(node& t1,node&t2)
{
    if(t1.x == t2.x)
    {
        return t1.y < t2.y;
    }
    return t1.x < t2.x;
}

node a[N];
int idex[N];
unordered_map<int,int> m1;
unordered_map<int,int> m2;
int m3[N];

void solve()
{
    cin >> n >> w;
    for(int i = 1;i <= n;i++)
    {
        cin >> a[i].x >> a[i].y;
        int x = a[i].x;
        int y = a[i].y;
        idex[x]++;
        m1[i] = idex[x];
        m3[idex[x]]++;
    }
    for(int i = 1;i <= n;i++)
    {
        int x = a[i].x;
        //if(m3[idex[x]] != )
    }
    sort(a + 1,a + n + 1,cmp);
    for(int i = 1;i <= n;i++)
    {
        int x = a[i].x;
        int y = a[i].y;
        m2[idex[x]] = max(m2[idex[x]],y);
    }
    cin >> q;
    while(q--)
    {
        int T,A;
        cin >> T >> A;
        if(m2[m1[A]] - T > 0)
        {
            cout << "Yes" << endl;
        } 
        else cout << "No" << endl;
    }
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}
